#include "comm.h"
#include "lua_comm.h"

#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"

int main(int argc, char * argv[]) 
{
    lua_State * L = lua_open();
    luaL_openlibs(L);
    luaopen_comm(L);

    lua_net = network_create(NETWORK_LT);

    int i;
    for (i = 1; i < argc; i++) {
        luaL_dofile(L, argv[i]);
    } 

    if (argc > 1) {
        network_loop(lua_net);
    }
    network_destory(lua_net);

    lua_close(L);
    return 0;
}
